package com.yujq.service;

import com.yujq.bean.accountBank;
import com.yujq.dao.accountBankMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Service;

@Service
public class TestService {
    private accountBankMapper accountBankMapper;
    @Autowired
    public void setAccountBankMapper(com.yujq.dao.accountBankMapper accountBankMapper) {
        this.accountBankMapper = accountBankMapper;
    }

    public void select(String account) {
        accountBank accountBank = accountBankMapper.selectByAccountNumber(account);
        System.out.println(accountBank.getBalance());
        System.out.println(accountBank.getAccountNumber());
        System.out.println(accountBank.getAccountCreateTime());
        System.out.println(accountBank.getAccountType());
        System.out.println(accountBank.getAccountCreateLocation());
        System.out.println(accountBank.getAccountName());
        System.out.println(accountBank.getCurrency());
    }

    public static void main(String[] args) {
        ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");
        accountServiceImpl bean = applicationContext.getBean("accountServiceImpl",accountServiceImpl.class);
        bean.transferAccounts("6226000098882323","6226000098882929",200);
        accountBank accountBank = bean.select("6226000098882323");
        bean.listFlow();
    }

}
